package com.es.disped.dao.mapper;

import com.es.disped.dao.model.Clazz;
import com.es.disped.dao.model.ClazzExample;
import java.util.List;

import org.apache.ibatis.annotations.CacheNamespace;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

/**
 * @author Anson<br>
 *	Copyright by EasyShare 2019<br>
 *  
 *  All right reserved<br>
 *
 *  Created on 2019年7月27日 下午8:45:04<br>
 *  名称：ClazzMapper.java<br>
 *  描述：班级模型<br>
 */
//@CacheNamespace(implementation=(com.es.disped.dao.cache.RedisCache.class),size=512,flushInterval=60000)
public interface ClazzMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @SelectProvider(type=ClazzSqlProvider.class, method="countByExample")
    long countByExample(ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @DeleteProvider(type=ClazzSqlProvider.class, method="deleteByExample")
    int deleteByExample(ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @Delete({
        "delete from clazz",
        "where clazz_id = #{clazzId,jdbcType=CHAR}"
    })
    int deleteByPrimaryKey(String clazzId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @Insert({
        "insert into clazz (clazz_id, clazz_name, ",
        "syllabus_id, syllabus_name, ",
        "teacher_id, teacher_name, ",
        "assistant_id, assistant_name, ",
        "clazz_student_num, clazz_max_student, ",
        "clazz_valid, clazz_description)",
        "values (#{clazzId,jdbcType=CHAR}, #{clazzName,jdbcType=VARCHAR}, ",
        "#{syllabusId,jdbcType=CHAR}, #{syllabusName,jdbcType=VARCHAR}, ",
        "#{teacherId,jdbcType=CHAR}, #{teacherName,jdbcType=VARCHAR}, ",
        "#{assistantId,jdbcType=CHAR}, #{assistantName,jdbcType=VARCHAR}, ",
        "#{clazzStudentNum,jdbcType=INTEGER}, #{clazzMaxStudent,jdbcType=INTEGER}, ",
        "#{clazzValid,jdbcType=INTEGER}, #{clazzDescription,jdbcType=LONGVARCHAR})"
    })
    int insert(Clazz record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @InsertProvider(type=ClazzSqlProvider.class, method="insertSelective")
    int insertSelective(Clazz record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @SelectProvider(type=ClazzSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="clazz_id", property="clazzId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="clazz_name", property="clazzName", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="teacher_id", property="teacherId", jdbcType=JdbcType.CHAR),
        @Result(column="teacher_name", property="teacherName", jdbcType=JdbcType.VARCHAR),
        @Result(column="assistant_id", property="assistantId", jdbcType=JdbcType.CHAR),
        @Result(column="assistant_name", property="assistantName", jdbcType=JdbcType.VARCHAR),
        @Result(column="clazz_student_num", property="clazzStudentNum", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_max_student", property="clazzMaxStudent", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_valid", property="clazzValid", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_description", property="clazzDescription", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Clazz> selectByExampleWithBLOBs(ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @SelectProvider(type=ClazzSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="clazz_id", property="clazzId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="clazz_name", property="clazzName", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="teacher_id", property="teacherId", jdbcType=JdbcType.CHAR),
        @Result(column="teacher_name", property="teacherName", jdbcType=JdbcType.VARCHAR),
        @Result(column="assistant_id", property="assistantId", jdbcType=JdbcType.CHAR),
        @Result(column="assistant_name", property="assistantName", jdbcType=JdbcType.VARCHAR),
        @Result(column="clazz_student_num", property="clazzStudentNum", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_max_student", property="clazzMaxStudent", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_valid", property="clazzValid", jdbcType=JdbcType.INTEGER)
    })
    List<Clazz> selectByExample(ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @Select({
        "select",
        "clazz_id, clazz_name, syllabus_id, syllabus_name, teacher_id, teacher_name, ",
        "assistant_id, assistant_name, clazz_student_num, clazz_max_student, clazz_valid, ",
        "clazz_description",
        "from clazz",
        "where clazz_id = #{clazzId,jdbcType=CHAR}"
    })
    @Results({
        @Result(column="clazz_id", property="clazzId", jdbcType=JdbcType.CHAR, id=true),
        @Result(column="clazz_name", property="clazzName", jdbcType=JdbcType.VARCHAR),
        @Result(column="syllabus_id", property="syllabusId", jdbcType=JdbcType.CHAR),
        @Result(column="syllabus_name", property="syllabusName", jdbcType=JdbcType.VARCHAR),
        @Result(column="teacher_id", property="teacherId", jdbcType=JdbcType.CHAR),
        @Result(column="teacher_name", property="teacherName", jdbcType=JdbcType.VARCHAR),
        @Result(column="assistant_id", property="assistantId", jdbcType=JdbcType.CHAR),
        @Result(column="assistant_name", property="assistantName", jdbcType=JdbcType.VARCHAR),
        @Result(column="clazz_student_num", property="clazzStudentNum", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_max_student", property="clazzMaxStudent", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_valid", property="clazzValid", jdbcType=JdbcType.INTEGER),
        @Result(column="clazz_description", property="clazzDescription", jdbcType=JdbcType.LONGVARCHAR)
    })
    Clazz selectByPrimaryKey(String clazzId);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @UpdateProvider(type=ClazzSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") Clazz record, @Param("example") ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @UpdateProvider(type=ClazzSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") Clazz record, @Param("example") ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @UpdateProvider(type=ClazzSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Clazz record, @Param("example") ClazzExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @UpdateProvider(type=ClazzSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(Clazz record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @Update({
        "update clazz",
        "set clazz_name = #{clazzName,jdbcType=VARCHAR},",
          "syllabus_id = #{syllabusId,jdbcType=CHAR},",
          "syllabus_name = #{syllabusName,jdbcType=VARCHAR},",
          "teacher_id = #{teacherId,jdbcType=CHAR},",
          "teacher_name = #{teacherName,jdbcType=VARCHAR},",
          "assistant_id = #{assistantId,jdbcType=CHAR},",
          "assistant_name = #{assistantName,jdbcType=VARCHAR},",
          "clazz_student_num = #{clazzStudentNum,jdbcType=INTEGER},",
          "clazz_max_student = #{clazzMaxStudent,jdbcType=INTEGER},",
          "clazz_valid = #{clazzValid,jdbcType=INTEGER},",
          "clazz_description = #{clazzDescription,jdbcType=LONGVARCHAR}",
        "where clazz_id = #{clazzId,jdbcType=CHAR}"
    })
    int updateByPrimaryKeyWithBLOBs(Clazz record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table clazz
     *
     * @mbg.generated Sat Jul 06 14:10:05 CST 2019
     */
    @Update({
        "update clazz",
        "set clazz_name = #{clazzName,jdbcType=VARCHAR},",
          "syllabus_id = #{syllabusId,jdbcType=CHAR},",
          "syllabus_name = #{syllabusName,jdbcType=VARCHAR},",
          "teacher_id = #{teacherId,jdbcType=CHAR},",
          "teacher_name = #{teacherName,jdbcType=VARCHAR},",
          "assistant_id = #{assistantId,jdbcType=CHAR},",
          "assistant_name = #{assistantName,jdbcType=VARCHAR},",
          "clazz_student_num = #{clazzStudentNum,jdbcType=INTEGER},",
          "clazz_max_student = #{clazzMaxStudent,jdbcType=INTEGER},",
          "clazz_valid = #{clazzValid,jdbcType=INTEGER}",
        "where clazz_id = #{clazzId,jdbcType=CHAR}"
    })
    int updateByPrimaryKey(Clazz record);
}